Certified Platform Developer II v1.0

Page:    1 / 28   
Exam contains 419 questions

What are three benefits of using declarative customizations over code? (Choose three.)

  • A. Declarative customizations cannot generate run time errors.
  • B. Declarative customizations will automatically update with each Salesforce release.
  • C. Declarative customizations do not require user testing.
  • D. Declarative customizations are not subject to governor limits.
  • E. Declarative customizations generally require less maintenance.


Answer : BDE

Which use case can only be performed by using asynchronous Apex?

  • A. Scheduling a batch process to complete in the future
  • B. Processing high volumes of records
  • C. Updating a record after the completion of an insert
  • D. Calling a web service from an Apex trigger


Answer : D

@isTest
static void testIncrement() {
Account acct = new Account(Name = 'Test');
acct.Number_Of_Times_Viewed__c = 0;
insert acct;
AuditUtil.incrementViewed(acct.Id);
Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0]
System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c);
}
The test method above calls an @future method that increments the Number_of_Times_Viewed__c value. The assertion is failing because the
Number_of_Times_Viewed__c equals 0.
What is the optimal way to fix this?

  • A. Change the initialization to acct.Number_Of_Times_Viewed__c = 1.
  • B. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
  • C. Add Test.startTest() before and Test.stopTest() after insert acct.
  • D. Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).


Answer : A

A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order__c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST call to Salesforce should be made that creates an Order record in Salesforce and relates it to the proper Account.
What is the optimal way to implement this?

  • A. Perform a REST GET on the Account and a REST POST to update the Order__c with the Accountג€™s record ID.
  • B. Perform a REST PATCH to upsert the Order__c and specify the Accountג€™s Customer_Number__c in it.
  • C. Perform a REST POST to update the Order__c and specify the Accountג€™s Customer_Number__c in it.
  • D. Perform a REST GET on the Account and a REST PATCH to upsert the Order__c with the Accountג€™s record ID.


Answer : B

What are three benefits of using static resources in Visualforce and Lightning Components? (Choose three.)

  • A. Static resource files are automatically minified.
  • B. Static resource files can be referenced by using the $Resource global variable instead of hardcoded IDs.
  • C. Static resource files can be packaged into a collection of related files in a zip or jar archive.
  • D. Static resource files do not count against an organizationג€™s quota of data storage.
  • E. Relative paths can be used in files in static resource archives to refer to other content within the archive.


Answer : BCE

A company has a native iOS app for placing orders that needs to connect to Salesforce to retrieve consolidated information from many different objects in a JSON format.
Which is the optimal method to implement this in Salesforce?

  • A. Apex REST Web Service
  • B. Apex SOAP Web Service
  • C. Apex SOAP Callout
  • D. Apex REST Callout


Answer : A

A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an
Opportunity's Probability is greater than 50%.
What is the optimal way to automate this?

  • A. Use an Apex Trigger on Opportunity.
  • B. Build a Flow on Opportunity.
  • C. Create a Workflow on Opportunity.
  • D. Build a Process on Opportunity.


Answer : A

A company represents their customers as Accounts in Salesforce. All customers have a unique Customer_Number__c that is unique across all of the company's systems. They also have a custom Invoice__c object, with a Lookup to Account, to represent invoices that are sent out from their external system. This company wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer is paying their bills on time.
What is the optimal way to implement this?

  • A. Ensure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly.
  • B. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice.
  • C. Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly.
  • D. Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.


Answer : A

An Apex trigger creates an Order__c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders.
What is the optimal method for a developer to troubleshoot this?

  • A. Set up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.
  • B. Turn off all Workflow Rules, then turn them on one at time to see which one causes the error.
  • C. Add system.debug() statements to the code and use the Developer Console logs to trace the code.
  • D. Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.


Answer : C

A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?

  • A. Create a Process, call an Apex @future(callout=true) method from it, and make the callout from that Apex method.
  • B. Create a Process, call an Apex @InvocableMethod from it, and make the callout from that Apex method.
  • C. Create an after insert trigger, call an Apex @InvocableMethod method from it, and make the callout from that Apex method.
  • D. Create an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method.


Answer : D

Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?

  • A. insert (records, false)
  • B. Database.insert(records, false)
  • C. Database.insert(records, true)
  • D. insert records


Answer : B

Which two relationship queries use the proper syntax? (Choose two.)

  • A. SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry = 'Media'
  • B. SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
  • C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
  • D. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'


Answer : CD

A developer built a Component to be used at the front desk for quests to self-register upon arrival at a kiosk. The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk.
What should be used?

  • A. Application Event
  • B. DML Operation
  • C. Component Event
  • D. ChangeLog


Answer : A

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?

  • A. List <Contact> contactList = new List <Contact>(); for(Opportunity o : opportunityList){ Account a = [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id = :o.AccountId] contactList.addAll(a.Contacts); )
  • B. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for (Opportunity o : opportunityList){ contactIds.add(o.ContactId); } for(Contact c : [SELECT Id FROM Contact WHERE Id IN :contactIds]){ contactList.add(c); }
  • C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }
  • D. List <Contact> contactList = new List <Contact>(); for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId] ){ contactList.add(c); }


Answer : C

An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.
When a test batch of records is loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
What is the most extendable way to update the Apex Trigger to accomplish this?

  • A. Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.
  • B. Use a List Custom Setting to disable the Trigger for the user who does the data loading.
  • C. Add the Profile Id of the user who does the data loading to the Trigger so the Trigger wonג€™t fire for this user.
  • D. Add a Validation Rule to the Contract to prevent Contract creation by the user who does the data loading.


Answer : A

Page:    1 / 28   
Exam contains 419 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us

Certlibrary.com is owned by MBS Tech Limited: Room 1905 Nam Wo Hong Building, 148 Wing Lok Street, Sheung Wan, Hong Kong. Company registration number: 2310926
Certlibrary doesn't offer Real Microsoft Exam Questions. Certlibrary Materials do not contain actual questions and answers from Cisco's Certification Exams.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.
Terms & Conditions | Privacy Policy